﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Globalization;
using System.Web.Mvc;
using System.Web.Security;

namespace StonePonyMVC.Models
{

    public class LogOnModel
    {
        [Required]
        [DataType(DataType.EmailAddress)]
        [Display(Name = "Email")]
        public string Email { get; set; }

        [Required]
        [DataType(DataType.Password)]
        [Display(Name = "Password")]
        public string Password { get; set; }

        [Display(Name = "Remember me?")]
        public bool RememberMe { get; set; }
    }

    public class ChangePasswordModel
    {
        [Required]
        [DataType(DataType.Password)]
        [Display(Name = "Current password")]
        public string OldPassword { get; set; }

        [Required]
        [StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)]
        [DataType(DataType.Password)]
        [Display(Name = "New password")]
        public string NewPassword { get; set; }

        [DataType(DataType.Password)]
        [Display(Name = "Confirm new password")]
        [Compare("NewPassword", ErrorMessage = "The new password and confirmation password do not match.")]
        public string ConfirmPassword { get; set; }
    }

    public class RegisterModel
    {
        /// <summary>
        /// user_email
        /// </summary>
        [Required]
        [DataType(DataType.EmailAddress)]
        [RegularExpression("^(?i)[a-z0-9_\\+-]+(\\.[a-z0-9_\\+-]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*\\.([a-z]{2,4})$", ErrorMessage = "Invalid format")]
        [Display(Name = "Email address")]
        public string Email { get; set; }

        /// <summary>
        /// user_password
        /// </summary>
        [Required]
        [StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)]
        [DataType(DataType.Password)]
        [Display(Name = "Password")]
        public string Password { get; set; }

        /// <summary>
        /// user_password
        /// </summary>
        [Required]
        [DataType(DataType.Password)]
        [Display(Name = "Confirm password")]
        [Compare("Password", ErrorMessage = "The password and confirmation password do not match.")]
        public string ConfirmPassword { get; set; }

        /// <summary>
        /// user_firstname
        /// </summary>
        [Display(Name = "First and last names")]
        public string FirstName { get; set; }

        /// <summary>
        /// user_lastname
        /// </summary>
        [Display(Name = "Last name")]
        public string LastName { get; set; }

        /// <summary>
        /// user_company
        /// </summary>
        [Display(Name = "Company name")]
        public string CompanyName { get; set; }

        /// <summary>
        /// user_phone_1
        /// </summary>
        [Display(Name = "Phone number")]
        public string Phone_1 { get; set; }

        /// <summary>
        /// user_phone_2
        /// </summary>
        [Display(Name = "Phone number")]
        public string Phone_2 { get; set; }

        /// <summary>
        /// user_phone_3
        /// </summary>
        [Display(Name = "Phone number")]
        public string Phone_3 { get; set; }

        /// <summary>
        /// email_them
        /// </summary>
        [Display(Name = "Send notifications")]
        public bool EmailThem { get; set; }

    }
}
